Evaluation of oyster exposure experiments

knitr::opts_chunk$set(echo = TRUE, warning = F, message = F, fig.path = 'figs/', dev.args = list(family = 'serif'))

library(tidyverse)
library(patchwork)
library(ggbeeswarm)
library(psycho)
library(lmerTest)
library(hrbrthemes)
library(kableExtra)
library(shiny)

source('R/funcs.R')

data(allexp)
data(bymods)
data(wtmods)

Number of folds

Raw data

yvar <- 'Number of folds'

toplo <- allexp %>% 
  filter(var %in% yvar)

p <- ggplot(toplo, aes(x = factor(week), y = val, colour = species, fill = species)) + 
  geom_boxplot(outlier.shape = NA, alpha = 0.1) + 
  geom_point(aes(group = species), position = position_jitterdodge(jitter.width = 0.1), size = 2, alpha = 0.6) + 
  theme_ipsum_rc() + 
  facet_grid(trt~ .) + 
  scale_colour_ipsum() + 
  scale_fill_ipsum() + 
  theme(legend.title = element_blank()) + 
  labs(x = 'Exposure week', y = yvar)

p

Models by week

Olympia oyster

bymods %>% 
  filter(species == 'Olympia') %>% 
  filter(var == yvar) %>% 
  pull(plomod)

Pacific oyster

bymods %>% 
  filter(species == 'Pacific') %>% 
  filter(var == yvar) %>% 
  pull(plomod)

Models with week

Olympia oyster

dat <- wtmods %>% 
  filter(species == 'Olympia') %>% 
  filter(var == yvar)

dat %>% 
  filter(species == 'Olympia') %>% 
  pull(anomodnoint) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week + treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Number of folds vs week + treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 0.74 0.18 4 32.45 11.48 0.00
week 0.01 0.01 2 30.48 0.38 0.69
dat %>% 
  filter(species == 'Olympia') %>% 
  pull(anomod) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week x treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Number of folds vs week x treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 0.63 0.16 4 25.69 9.92 0.00
week 0.01 0.01 2 24.16 0.42 0.66
trt:week 0.07 0.01 8 25.46 0.58 0.79
dat %>% 
  pull(plomod)

Pacific oyster

dat <- wtmods %>% 
  filter(species == 'Pacific') %>% 
  filter(var == yvar)
         
dat %>% 
  filter(species == 'Pacific') %>% 
  pull(anomodnoint) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week + treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Number of folds vs week + treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 0.66 0.17 4 38.14 8.31 0.00
week 0.01 0.00 2 36.80 0.21 0.81
dat %>% 
  filter(species == 'Pacific') %>% 
  pull(anomod) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week x treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Number of folds vs week x treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 0.73 0.18 4 31.25 9.19 0.00
week 0.01 0.01 2 30.19 0.36 0.70
trt:week 0.23 0.03 8 31.05 1.42 0.23
dat %>% 
  pull(plomod)

Number of irregularites

Raw data

yvar <- 'Number of irregularities'

toplo <- allexp %>% 
  filter(var %in% yvar)

p <- ggplot(toplo, aes(x = factor(week), y = val, colour = species, fill = species)) + 
  geom_boxplot(outlier.shape = NA, alpha = 0.1) + 
  geom_point(aes(group = species), position = position_jitterdodge(jitter.width = 0.1), size = 2, alpha = 0.6) + 
  theme_ipsum_rc() + 
  facet_grid(trt~ .) + 
  scale_colour_ipsum() + 
  scale_fill_ipsum() + 
  theme(legend.title = element_blank()) + 
  labs(x = 'Exposure week', y = yvar)

p

Models by week

Olympia oyster

bymods %>% 
  filter(species == 'Olympia') %>% 
  filter(var == yvar) %>% 
  pull(plomod)

Pacific oyster

bymods %>% 
  filter(species == 'Pacific') %>% 
  filter(var == yvar) %>% 
  pull(plomod)

Models with week

Olympia oyster

dat <- wtmods %>% 
  filter(species == 'Olympia') %>% 
  filter(var == yvar)

dat %>% 
  filter(species == 'Olympia') %>% 
  pull(anomodnoint) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week + treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Number of irregularities vs week + treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 0.31 0.08 4 37.07 1.68 0.18
week 0.06 0.03 2 31.63 0.64 0.54
dat %>% 
  filter(species == 'Olympia') %>% 
  pull(anomod) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week x treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Number of irregularities vs week x treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 0.38 0.10 4 26.01 2.24 0.09
week 0.07 0.03 2 23.62 0.80 0.46
trt:week 0.53 0.07 8 26.22 1.54 0.19
dat %>% 
  pull(plomod)

Pacific oyster

dat <- wtmods %>% 
  filter(species == 'Pacific') %>% 
  filter(var == yvar)
         
dat %>% 
  filter(species == 'Pacific') %>% 
  pull(anomodnoint) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week + treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Number of irregularities vs week + treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 0.45 0.11 4 38.34 4.00 0.01
week 0.02 0.01 2 36.72 0.32 0.73
dat %>% 
  filter(species == 'Pacific') %>% 
  pull(anomod) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week x treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Number of irregularities vs week x treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 0.70 0.18 4 27.51 6.08 0.00
week 0.03 0.02 2 26.70 0.53 0.60
trt:week 0.78 0.10 8 27.19 3.40 0.01
dat %>% 
  pull(plomod)

Total observations (dissolution)

Raw data

yvar <- 'Total observations'

toplo <- allexp %>% 
  filter(var %in% yvar)

p <- ggplot(toplo, aes(x = factor(week), y = val, colour = species, fill = species)) + 
  geom_boxplot(outlier.shape = NA, alpha = 0.1) + 
  geom_point(aes(group = species), position = position_jitterdodge(jitter.width = 0.1), size = 2, alpha = 0.6) + 
  theme_ipsum_rc() + 
  facet_grid(trt~ .) + 
  scale_colour_ipsum() + 
  scale_fill_ipsum() + 
  theme(legend.title = element_blank()) + 
  labs(x = 'Exposure week', y = yvar)

p

Models by week

Olympia oyster

bymods %>% 
  filter(species == 'Olympia') %>% 
  filter(var == yvar) %>% 
  pull(plomod)

Pacific oyster

bymods %>% 
  filter(species == 'Pacific') %>% 
  filter(var == yvar) %>% 
  pull(plomod)

Models with week

Olympia oyster

dat <- wtmods %>% 
  filter(species == 'Olympia') %>% 
  filter(var == yvar)

dat %>% 
  filter(species == 'Olympia') %>% 
  pull(anomodnoint) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week + treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Total observations vs week + treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 1.16 0.29 4 39.12 1.19 0.33
week 0.14 0.07 2 35.48 0.30 0.75
dat %>% 
  filter(species == 'Olympia') %>% 
  pull(anomod) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week x treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Total observations vs week x treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 1.42 0.36 4 31.93 1.48 0.23
week 0.16 0.08 2 29.77 0.33 0.72
trt:week 2.37 0.30 8 31.83 1.23 0.31
dat %>% 
  pull(plomod)

Pacific oyster

dat <- wtmods %>% 
  filter(species == 'Pacific') %>% 
  filter(var == yvar)
         
dat %>% 
  filter(species == 'Pacific') %>% 
  pull(anomodnoint) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week + treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Total observations vs week + treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 1.55 0.39 4 36.54 1.16 0.34
week 2.40 1.20 2 34.90 3.61 0.04
dat %>% 
  filter(species == 'Pacific') %>% 
  pull(anomod) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week x treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Total observations vs week x treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 1.87 0.47 4 28.70 1.40 0.26
week 2.71 1.36 2 27.63 4.07 0.03
trt:week 4.51 0.56 8 28.56 1.69 0.14
dat %>% 
  pull(plomod)

Dissolution score

Raw data

yvar <- 'Dissolution score (0-3)'

toplo <- allexp %>% 
  filter(var %in% yvar)

p <- ggplot(toplo, aes(x = factor(week), y = val, colour = species, fill = species)) + 
  geom_boxplot(outlier.shape = NA, alpha = 0.1) + 
  geom_point(aes(group = species), position = position_jitterdodge(jitter.width = 0.1), size = 2, alpha = 0.6) + 
  theme_ipsum_rc() + 
  facet_grid(trt~ .) + 
  scale_colour_ipsum() + 
  scale_fill_ipsum() + 
  theme(legend.title = element_blank()) + 
  labs(x = 'Exposure week', y = yvar)

p

Models by week

Olympia oyster

bymods %>% 
  filter(species == 'Olympia') %>% 
  filter(var == yvar) %>% 
  pull(plomod)

Pacific oyster

bymods %>% 
  filter(species == 'Pacific') %>% 
  filter(var == yvar) %>% 
  pull(plomod)

Models with week

Olympia oyster

dat <- wtmods %>% 
  filter(species == 'Olympia') %>% 
  filter(var == yvar)

dat %>% 
  filter(species == 'Olympia') %>% 
  pull(anomodnoint) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week + treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Dissolution score (0-3) vs week + treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 3.90 0.97 4 39.04 9.20 0.00
week 0.07 0.03 2 36.14 0.32 0.73
dat %>% 
  filter(species == 'Olympia') %>% 
  pull(anomod) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week x treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Dissolution score (0-3) vs week x treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 4.78 1.19 4 28.14 10.96 0.00
week 0.05 0.02 2 26.69 0.22 0.81
trt:week 1.37 0.17 8 27.81 1.58 0.18
dat %>% 
  pull(plomod)

Pacific oyster

dat <- wtmods %>% 
  filter(species == 'Pacific') %>% 
  filter(var == yvar)
         
dat %>% 
  filter(species == 'Pacific') %>% 
  pull(anomodnoint) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week + treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Dissolution score (0-3) vs week + treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 3.24 0.81 4 37.38 10.71 0.0
week 0.14 0.07 2 36.11 0.95 0.4
dat %>% 
  filter(species == 'Pacific') %>% 
  pull(anomod) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week x treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Dissolution score (0-3) vs week x treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 3.30 0.82 4 27.73 10.76 0.00
week 0.15 0.07 2 26.72 0.97 0.39
trt:week 0.49 0.06 8 27.56 0.80 0.61
dat %>% 
  pull(plomod)

Shell weight

Raw data

yvar <- 'Shell weight (g)'

toplo <- allexp %>% 
  filter(var %in% yvar)

p <- ggplot(toplo, aes(x = factor(week), y = val, colour = species, fill = species)) + 
  geom_boxplot(outlier.shape = NA, alpha = 0.1) + 
  geom_point(aes(group = species), position = position_jitterdodge(jitter.width = 0.1), size = 2, alpha = 0.6) + 
  theme_ipsum_rc() + 
  facet_grid(trt~ .) + 
  scale_colour_ipsum() + 
  scale_fill_ipsum() + 
  theme(legend.title = element_blank()) + 
  labs(x = 'Exposure week', y = yvar)

p

Models by week

Olympia oyster

bymods %>% 
  filter(species == 'Olympia') %>% 
  filter(var == yvar) %>% 
  pull(plomod)

Pacific oyster

bymods %>% 
  filter(species == 'Pacific') %>% 
  filter(var == yvar) %>% 
  pull(plomod)

Models with week

Olympia oyster

dat <- wtmods %>% 
  filter(species == 'Olympia') %>% 
  filter(var == yvar)

dat %>% 
  filter(species == 'Olympia') %>% 
  pull(anomodnoint) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week + treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Shell weight (g) vs week + treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 0.05 0.01 4 59.65 0.33 0.86
week 0.10 0.05 2 60.13 1.31 0.28
dat %>% 
  filter(species == 'Olympia') %>% 
  pull(anomod) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week x treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Shell weight (g) vs week x treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 0.05 0.01 4 50.58 0.34 0.85
week 0.09 0.05 2 51.98 1.23 0.30
trt:week 0.27 0.03 8 52.01 0.90 0.52
dat %>% 
  pull(plomod)

Pacific oyster

dat <- wtmods %>% 
  filter(species == 'Pacific') %>% 
  filter(var == yvar)
         
dat %>% 
  filter(species == 'Pacific') %>% 
  pull(anomodnoint) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week + treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Shell weight (g) vs week + treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 0.05 0.01 4 53.91 1.29 0.29
week 0.03 0.01 2 53.07 1.28 0.29
dat %>% 
  filter(species == 'Pacific') %>% 
  pull(anomod) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week x treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Shell weight (g) vs week x treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 0.06 0.01 4 43.46 1.44 0.24
week 0.03 0.01 2 43.60 1.34 0.27
trt:week 0.11 0.01 8 43.61 1.39 0.23
dat %>% 
  pull(plomod)

Tissue weight

Raw data

yvar <- 'Tissue weight (g)'

toplo <- allexp %>% 
  filter(var %in% yvar)

p <- ggplot(toplo, aes(x = factor(week), y = val, colour = species, fill = species)) + 
  geom_boxplot(outlier.shape = NA, alpha = 0.1) + 
  geom_point(aes(group = species), position = position_jitterdodge(jitter.width = 0.1), size = 2, alpha = 0.6) + 
  theme_ipsum_rc() + 
  facet_grid(trt~ .) + 
  scale_colour_ipsum() + 
  scale_fill_ipsum() + 
  theme(legend.title = element_blank()) + 
  labs(x = 'Exposure week', y = yvar)

p

Models by week

Olympia oyster

bymods %>% 
  filter(species == 'Olympia') %>% 
  filter(var == yvar) %>% 
  pull(plomod)

Pacific oyster

bymods %>% 
  filter(species == 'Pacific') %>% 
  filter(var == yvar) %>% 
  pull(plomod)

Models with week

Olympia oyster

dat <- wtmods %>% 
  filter(species == 'Olympia') %>% 
  filter(var == yvar)

dat %>% 
  filter(species == 'Olympia') %>% 
  pull(anomodnoint) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week + treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Tissue weight (g) vs week + treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 0 0 4 59.92 0.59 0.67
week 0 0 2 60.38 1.29 0.28
dat %>% 
  filter(species == 'Olympia') %>% 
  pull(anomod) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week x treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Tissue weight (g) vs week x treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 0.00 0 4 51.28 0.62 0.65
week 0.00 0 2 52.70 1.23 0.30
trt:week 0.01 0 8 52.73 0.68 0.71
dat %>% 
  pull(plomod)

Pacific oyster

dat <- wtmods %>% 
  filter(species == 'Pacific') %>% 
  filter(var == yvar)
         
dat %>% 
  filter(species == 'Pacific') %>% 
  pull(anomodnoint) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week + treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Tissue weight (g) vs week + treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 0 0 4 51.40 0.71 0.59
week 0 0 2 50.57 0.86 0.43
dat %>% 
  filter(species == 'Pacific') %>% 
  pull(anomod) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week x treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Tissue weight (g) vs week x treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 0.00 0 4 41.32 0.87 0.49
week 0.00 0 2 41.46 0.92 0.41
trt:week 0.01 0 8 41.48 1.32 0.26
dat %>% 
  pull(plomod)

Whole weight

Raw data

yvar <- 'Whole weight (g)'

toplo <- allexp %>% 
  filter(var %in% yvar)

p <- ggplot(toplo, aes(x = factor(week), y = val, colour = species, fill = species)) + 
  geom_boxplot(outlier.shape = NA, alpha = 0.1) + 
  geom_point(aes(group = species), position = position_jitterdodge(jitter.width = 0.1), size = 2, alpha = 0.6) + 
  theme_ipsum_rc() + 
  facet_grid(trt~ .) + 
  scale_colour_ipsum() + 
  scale_fill_ipsum() + 
  theme(legend.title = element_blank()) + 
  labs(x = 'Exposure week', y = yvar)

p

Models by week

Olympia oyster

bymods %>% 
  filter(species == 'Olympia') %>% 
  filter(var == yvar) %>% 
  pull(plomod)

Pacific oyster

bymods %>% 
  filter(species == 'Pacific') %>% 
  filter(var == yvar) %>% 
  pull(plomod)

Models with week

Olympia oyster

dat <- wtmods %>% 
  filter(species == 'Olympia') %>% 
  filter(var == yvar)

dat %>% 
  filter(species == 'Olympia') %>% 
  pull(anomodnoint) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week + treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Whole weight (g) vs week + treatment
Df Deviance Resid. Df Resid. Dev
NULL NA NA 286 21.97
trt 4 0.64 282 21.33
week 2 0.92 280 20.41
dat %>% 
  filter(species == 'Olympia') %>% 
  pull(anomod) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week x treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Whole weight (g) vs week x treatment
Df Deviance Resid. Df Resid. Dev
NULL NA NA 286 21.97
trt 4 0.64 282 21.33
week 2 0.92 280 20.41
trt:week 8 1.03 272 19.38
dat %>% 
  pull(plomod)

Pacific oyster

dat <- wtmods %>% 
  filter(species == 'Pacific') %>% 
  filter(var == yvar)
         
dat %>% 
  filter(species == 'Pacific') %>% 
  pull(anomodnoint) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week + treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Whole weight (g) vs week + treatment
Df Deviance Resid. Df Resid. Dev
NULL NA NA 275 7.04
trt 4 0.15 271 6.90
week 2 0.15 269 6.75
dat %>% 
  filter(species == 'Pacific') %>% 
  pull(anomod) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week x treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Whole weight (g) vs week x treatment
Df Deviance Resid. Df Resid. Dev
NULL NA NA 275 7.04
trt 4 0.15 271 6.90
week 2 0.15 269 6.75
trt:week 8 1.20 261 5.54
dat %>% 
  pull(plomod)

Delta length

Raw data

yvar <- 'Delta length (cm)'

toplo <- allexp %>% 
  filter(var %in% yvar)

p <- ggplot(toplo, aes(x = factor(week), y = val, colour = species, fill = species)) + 
  geom_boxplot(outlier.shape = NA, alpha = 0.1) + 
  geom_point(aes(group = species), position = position_jitterdodge(jitter.width = 0.1), size = 2, alpha = 0.6) + 
  theme_ipsum_rc() + 
  facet_grid(trt~ .) + 
  scale_colour_ipsum() + 
  scale_fill_ipsum() + 
  theme(legend.title = element_blank()) + 
  labs(x = 'Exposure week', y = yvar)

p

Models by week

Olympia oyster

bymods %>% 
  filter(species == 'Olympia') %>% 
  filter(var == yvar) %>% 
  pull(plomod)

Pacific oyster

bymods %>% 
  filter(species == 'Pacific') %>% 
  filter(var == yvar) %>% 
  pull(plomod)

Models with week

Olympia oyster

dat <- wtmods %>% 
  filter(species == 'Olympia') %>% 
  filter(var == yvar)

dat %>% 
  filter(species == 'Olympia') %>% 
  pull(anomodnoint) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week + treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Delta length (cm) vs week + treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 0.03 0.01 4 37.30 0.29 0.88
week 0.14 0.14 1 37.49 5.91 0.02
dat %>% 
  filter(species == 'Olympia') %>% 
  pull(anomod) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week x treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Delta length (cm) vs week x treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 0.02 0.01 4 34.13 0.23 0.92
week 0.11 0.11 1 34.10 4.62 0.04
trt:week 0.08 0.02 4 34.13 0.83 0.52
dat %>% 
  pull(plomod)

Pacific oyster

dat <- wtmods %>% 
  filter(species == 'Pacific') %>% 
  filter(var == yvar)
         
dat %>% 
  filter(species == 'Pacific') %>% 
  pull(anomodnoint) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week + treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Delta length (cm) vs week + treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 0.05 0.01 4 37.78 0.59 0.67
week 0.01 0.01 1 37.78 0.25 0.62
dat %>% 
  filter(species == 'Pacific') %>% 
  pull(anomod) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week x treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Delta length (cm) vs week x treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 0.19 0.05 4 36.15 2.14 0.10
week 0.08 0.08 1 38.49 3.53 0.07
trt:week 0.29 0.07 4 36.15 3.36 0.02
dat %>% 
  pull(plomod)

Delta width

Raw data

yvar <- 'Delta width (cm)'

toplo <- allexp %>% 
  filter(var %in% yvar)

p <- ggplot(toplo, aes(x = factor(week), y = val, colour = species, fill = species)) + 
  geom_boxplot(outlier.shape = NA, alpha = 0.1) + 
  geom_point(aes(group = species), position = position_jitterdodge(jitter.width = 0.1), size = 2, alpha = 0.6) + 
  theme_ipsum_rc() + 
  facet_grid(trt~ .) + 
  scale_colour_ipsum() + 
  scale_fill_ipsum() + 
  theme(legend.title = element_blank()) + 
  labs(x = 'Exposure week', y = yvar)

p

Models by week

Olympia oyster

bymods %>% 
  filter(species == 'Olympia') %>% 
  filter(var == yvar) %>% 
  pull(plomod)

Pacific oyster

bymods %>% 
  filter(species == 'Pacific') %>% 
  filter(var == yvar) %>% 
  pull(plomod)

Models with week

Olympia oyster

dat <- wtmods %>% 
  filter(species == 'Olympia') %>% 
  filter(var == yvar)

dat %>% 
  filter(species == 'Olympia') %>% 
  pull(anomodnoint) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week + treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Delta width (cm) vs week + treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 0.02 0.01 4 40.04 0.25 0.91
week 0.02 0.02 1 40.20 1.03 0.32
dat %>% 
  filter(species == 'Olympia') %>% 
  pull(anomod) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week x treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Delta width (cm) vs week x treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 0.02 0.01 4 35.76 0.26 0.90
week 0.02 0.02 1 35.72 0.73 0.40
trt:week 0.07 0.02 4 35.76 0.73 0.58
dat %>% 
  pull(plomod)

Pacific oyster

dat <- wtmods %>% 
  filter(species == 'Pacific') %>% 
  filter(var == yvar)
         
dat %>% 
  filter(species == 'Pacific') %>% 
  pull(anomodnoint) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week + treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Delta width (cm) vs week + treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 0.04 0.01 4 34.37 0.51 0.73
week 0.00 0.00 1 34.68 0.05 0.83
dat %>% 
  filter(species == 'Pacific') %>% 
  pull(anomod) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week x treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Delta width (cm) vs week x treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 0.07 0.02 4 32.88 0.92 0.47
week 0.01 0.01 1 36.05 0.29 0.59
trt:week 0.14 0.03 4 32.88 1.75 0.16
dat %>% 
  pull(plomod)

Final length

Raw data

yvar <- 'Final length (cm)'

toplo <- allexp %>% 
  filter(var %in% yvar)

p <- ggplot(toplo, aes(x = factor(week), y = val, colour = species, fill = species)) + 
  geom_boxplot(outlier.shape = NA, alpha = 0.1) + 
  geom_point(aes(group = species), position = position_jitterdodge(jitter.width = 0.1), size = 2, alpha = 0.6) + 
  theme_ipsum_rc() + 
  facet_grid(trt~ .) + 
  scale_colour_ipsum() + 
  scale_fill_ipsum() + 
  theme(legend.title = element_blank()) + 
  labs(x = 'Exposure week', y = yvar)

p

Models by week

Olympia oyster

bymods %>% 
  filter(species == 'Olympia') %>% 
  filter(var == yvar) %>% 
  pull(plomod)

Pacific oyster

bymods %>% 
  filter(species == 'Pacific') %>% 
  filter(var == yvar) %>% 
  pull(plomod)

Models with week

Olympia oyster

dat <- wtmods %>% 
  filter(species == 'Olympia') %>% 
  filter(var == yvar)

dat %>% 
  filter(species == 'Olympia') %>% 
  pull(anomodnoint) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week + treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Final length (cm) vs week + treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 0.25 0.06 4 46.59 0.74 0.57
week 0.13 0.06 2 46.21 0.75 0.48
dat %>% 
  filter(species == 'Olympia') %>% 
  pull(anomod) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week x treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Final length (cm) vs week x treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 0.29 0.07 4 38.11 0.89 0.48
week 0.09 0.04 2 38.24 0.53 0.59
trt:week 0.64 0.08 8 38.26 0.96 0.48
dat %>% 
  pull(plomod)

Pacific oyster

dat <- wtmods %>% 
  filter(species == 'Pacific') %>% 
  filter(var == yvar)
         
dat %>% 
  filter(species == 'Pacific') %>% 
  pull(anomodnoint) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week + treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Final length (cm) vs week + treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 0.17 0.04 4 47.20 0.46 0.76
week 0.13 0.07 2 45.87 0.71 0.50
dat %>% 
  filter(species == 'Pacific') %>% 
  pull(anomod) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week x treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Final length (cm) vs week x treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 0.23 0.06 4 38.72 0.63 0.65
week 0.22 0.11 2 39.77 1.18 0.32
trt:week 0.75 0.09 8 38.71 1.01 0.45
dat %>% 
  pull(plomod)

Final width

Raw data

yvar <- 'Final width (cm)'

toplo <- allexp %>% 
  filter(var %in% yvar)

p <- ggplot(toplo, aes(x = factor(week), y = val, colour = species, fill = species)) + 
  geom_boxplot(outlier.shape = NA, alpha = 0.1) + 
  geom_point(aes(group = species), position = position_jitterdodge(jitter.width = 0.1), size = 2, alpha = 0.6) + 
  theme_ipsum_rc() + 
  facet_grid(trt~ .) + 
  scale_colour_ipsum() + 
  scale_fill_ipsum() + 
  theme(legend.title = element_blank()) + 
  labs(x = 'Exposure week', y = yvar)

p

Models by week

Olympia oyster

bymods %>% 
  filter(species == 'Olympia') %>% 
  filter(var == yvar) %>% 
  pull(plomod)

Pacific oyster

bymods %>% 
  filter(species == 'Pacific') %>% 
  filter(var == yvar) %>% 
  pull(plomod)

Models with week

Olympia oyster

dat <- wtmods %>% 
  filter(species == 'Olympia') %>% 
  filter(var == yvar)

dat %>% 
  filter(species == 'Olympia') %>% 
  pull(anomodnoint) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week + treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Final width (cm) vs week + treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 0.19 0.05 4 46.52 0.77 0.55
week 0.09 0.04 2 46.12 0.71 0.50
dat %>% 
  filter(species == 'Olympia') %>% 
  pull(anomod) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week x treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Final width (cm) vs week x treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 0.18 0.04 4 37.96 0.74 0.57
week 0.07 0.04 2 38.10 0.59 0.56
trt:week 0.39 0.05 8 38.12 0.81 0.59
dat %>% 
  pull(plomod)

Pacific oyster

dat <- wtmods %>% 
  filter(species == 'Pacific') %>% 
  filter(var == yvar)
         
dat %>% 
  filter(species == 'Pacific') %>% 
  pull(anomodnoint) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week + treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Final width (cm) vs week + treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 0.07 0.02 4 47.55 0.36 0.84
week 0.19 0.09 2 46.03 1.79 0.18
dat %>% 
  filter(species == 'Pacific') %>% 
  pull(anomod) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week x treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Final width (cm) vs week x treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 0.16 0.04 4 38.74 0.79 0.54
week 0.23 0.11 2 40.01 2.18 0.13
trt:week 0.52 0.06 8 38.65 1.25 0.30
dat %>% 
  pull(plomod)

Respiration

Raw data

yvar <- 'Respiration (umol/hr/g)'

toplo <- allexp %>% 
  filter(var %in% yvar)

p <- ggplot(toplo, aes(x = factor(week), y = val, colour = species, fill = species)) + 
  geom_boxplot(outlier.shape = NA, alpha = 0.1) + 
  geom_point(aes(group = species), position = position_jitterdodge(jitter.width = 0.1), size = 2, alpha = 0.6) + 
  theme_ipsum_rc() + 
  facet_grid(trt~ .) + 
  scale_colour_ipsum() + 
  scale_fill_ipsum() + 
  theme(legend.title = element_blank()) + 
  labs(x = 'Exposure week', y = yvar)

p

Models by week

Olympia oyster

bymods %>% 
  filter(species == 'Olympia') %>% 
  filter(var == yvar) %>% 
  pull(plomod)

Pacific oyster

bymods %>% 
  filter(species == 'Pacific') %>% 
  filter(var == yvar) %>% 
  pull(plomod)

Models with week

Olympia oyster

dat <- wtmods %>% 
  filter(species == 'Olympia') %>% 
  filter(var == yvar)

dat %>% 
  filter(species == 'Olympia') %>% 
  pull(anomodnoint) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week + treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Respiration (umol/hr/g) vs week + treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 16.68 4.17 4 51.04 0.34 0.85
week 9.67 4.83 2 55.99 0.40 0.67
dat %>% 
  filter(species == 'Olympia') %>% 
  pull(anomod) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week x treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Respiration (umol/hr/g) vs week x treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 13.93 3.48 4 44.51 0.29 0.88
week 10.23 5.12 2 46.96 0.42 0.66
trt:week 64.95 8.12 8 47.14 0.67 0.72
dat %>% 
  pull(plomod)

Pacific oyster

dat <- wtmods %>% 
  filter(species == 'Pacific') %>% 
  filter(var == yvar)
         
dat %>% 
  filter(species == 'Pacific') %>% 
  pull(anomodnoint) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week + treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Respiration (umol/hr/g) vs week + treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 40.25 10.06 4 53.53 0.73 0.58
week 11.31 5.66 2 52.35 0.41 0.67
dat %>% 
  filter(species == 'Pacific') %>% 
  pull(anomod) %>% 
  .[[1]] %>% 
  knitr::kable(format = 'html', digits = 2, caption = paste0(yvar, ' vs week x treatment')) %>%
  kable_styling(full_width = T, font_size = 14) %>% 
  HTML
Respiration (umol/hr/g) vs week x treatment
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
trt 37.54 9.39 4 45.50 0.69 0.61
week 9.84 4.92 2 44.45 0.36 0.70
trt:week 54.96 6.87 8 45.48 0.50 0.85
dat %>% 
  pull(plomod)